package com.server.service.impl;

import com.server.mapper.CommonMapper;
import com.server.service.CommentService;
import com.server.service.CommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CommonServiceImpl implements CommonService {
    @Autowired
    CommonMapper commonMapper;
    public void addPraise(Integer articleId,Integer userId){
        commonMapper.addPraise(articleId,userId);
    }

    @Override
    public Integer getPraiseCount(Integer articleId) {
        return commonMapper.getPraiseCount(articleId);
    }

    @Override
    public Integer isPraised(Integer articleId, Integer userId) {
        return commonMapper.isPraised(articleId,userId);
    }

    @Override
    public void addCollect(Integer articleId, Integer userId) {
        commonMapper.addCollect(articleId,userId);
    }

    @Override
    public Integer getCollectedCount(Integer articleId) {
        return commonMapper.getCollectedCount(articleId);
    }

    @Override
    public Integer isCollected(Integer articleId, Integer userId) {
        return commonMapper.isCollected(articleId,userId);
    }
}
